<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate"/>
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0"/>
<link rel="icon" href="http://dingdian.parllay.cn/dist/images/logo.png" type="image/x-icon"/>
<title>叮当一下商品列表</title>
<!--线上环境-->
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/css/dist/business-component-min.css">
<link rel="shortcut icon" href="http://dingdian.parllay.cn/dist/images/logo.png"/>
<link rel="bookmark" href="http://dingdian.parllay.cn/dist/images/logo.png"/>
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/layui/css/layui.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/jbox/jbox-min.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/PublicMob/css/dist/style.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/diy/diy-min.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/uploadify/uploadify-min.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/colorpicker/colorpicker.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/plugins/spectrum/spectrum.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/css/dist/home/Item/lists.css">
<link rel="stylesheet" href="http://md.yuxiaocloud.com/Public/css/dist/home/Item/add_step2.css">
<style>
    .my-suncode .layui-layer-btn>a{
        background-color:#1E9FFF;
        border-color:#1E9FFF;
        color:#fff;
    }
    #albums{z-index:999998;}
    .item_to_merchant_shop_div_back{
        position: fixed;
        top:0;
        left:0;
        width:100%;
        background:rgba(0,0,0,0.6);
        z-index:10;
        display:none;
    }
    .item_to_merchant_shop_div{
        position:absolute;
        top:0;
        left:0;
        bottom:0;
        right:0;
        margin:auto;
        width:66%;
        height:550px;
        background:#fff;
        border-radius:10px;
        color:#666;
        padding-bottom:20px;
        overflow:hidden;
    }
    .back_xian{
        width: 96.5%;
        margin-left: 1.5%;
        margin-top: 10px;
        margin-bottom: 10px;
        border: 1px solid #E7E7E8;
    }
    .back_item_img_div{
        width: 100px;
        height: 100px;
        margin-left: 1.5%;
        padding: 10px;
        border: 1px solid #E7E7E8;
        border-radius: 5px;
        float: left;
    }
    .back_item_info{
        overflow: hidden;
    }
    .back_item_img{
        width: 100%;
        height: 100%;
    }
    .back_item_name{
        margin-top: 15px;
        margin-left: 1.5%;
        margin-bottom: 15px;
        display: block;
    }
    .back_item_price{
        text-align: center;
        width: 15%;
        height: 120px;
        margin-left: 5%;
        float: right;
    }
    .back_item_price_title{
        font-size: 16px;
        margin-top: 20px;
        letter-spacing:2px;
    }
    .back_item_price_input{
        display: inline-block;
        padding: 6px 10px;
        border-radius: 3px;
        line-height: normal;
        font-size: 12px;
        color: #000;
        background: #fff;
        width: 98px;
        border: 1px solid #ccc;
        box-sizing: border-box;
    }
    .moreMini{
        text-align: center;
        width: 30%;
    }
    .fixed_to_shop{
        float: right;
        width: 30%;
        padding: 6px 10px;
        border-radius: 3px;
        line-height: normal;
        font-size: 12px;
        color: #000;
        background: #fff;
        border: 1px solid #ccc;
        box-sizing: border-box;
    }
    .close_item_to_merchant{
        position: absolute;
        top: 10px;
        right: 10px;
        width: 14px;
        height: 14px;
        background: url(http://md.yuxiaocloud.com/Public/plugins/jbox/Images/remove-black.png) no-repeat;
        cursor: pointer;
    }
    .save_item_to_merchant{
        width: 20%;
        margin-left: 40%;
        margin-top: 10px;
        height: 30px;
        cursor: pointer;
    }
    td.sort .gicon-edit:hover{
        cursor:pointer;
    }
    /*郝清振修改样式*/
    .check-sure{ margin-left:300px; position:relative; top:-8px; left:0;}
    .lable{ height:30px; line-height:30px; text-align: center; padding-left:5px; padding-right: 5px; min-width:75px; text-align: left;}
    .toget{ height:30px; line-height:30px; text-align: center; padding-left:5px; padding-right: 5px;}
    .time-input{ width:100px;}
    .lableCase{ width:400px; padding-right: 20px; padding-left:10px; padding-top:5px; padding-bottom:5px; margin-top: 0px; margin-bottom:0px;}
    .margin-r-10{ margin-right:10px;}
    .margin-l-10{ margin-left:10px;}
    .margin-r-20{ margin-right:20px;}
    .margin-l-20{ margin-left:20px;}
    .margin-r-30{ margin-right:30px;}
    .margin-r-60{ margin-right:60px;}
    .icon_check{ display: inline-block;}
    .wxtables td{ padding-top:0px; padding-bottom:0px;}
    .tables-btmctrl{ padding-top:0px;}
    .nextPageCase{ width:300px; margin:0 auto;}
    .tb-tbody td{height:80px; line-height:24px; padding-left:0px; padding-right:0px; text-align: center;}
    .wxtables th {border: 1px solid #eee; color: #333;}
    .wxtables td {border: 1px solid #eee; color: #333;}
    .tb-thead th{padding-top:10px; padding-bottom:10px; height:20px; line-height:20px; text-align:center;}
    .tb-imgCase-case{ width:100px; height:178px;}
    .tb-imgCase-case a{ width:100px; height:178px;}
    .tb-imgCase-case img{ width:100px; height:178px;}
    /*模态框*/
    .maskLayout{width:100%; height:100%; left:0; top:0; position:fixed; z-index:10;}
    .Layouter{background:#000; opacity:0.5; width:100%; height:100%;}
    .maskMotal{width:700px; height:560px; position:absolute; left:50%; top:50%; margin-left:-350px; margin-top:-280px; z-index:10; padding:10px 10px 10px 10px; background:#fff; border-radius:4px; border:1px solid #666;}
    .maskMotalConfirm{width:500px; height:100px; position:absolute; left:50%; top:50%; margin-left:-250px; margin-top:-50px;}
    .icon{color:#fff; line-height:30px; height:30px;}
    .must-icon{visibility:block; color:red; text-align:center; line-height:30px; height:30px;}
    .closeBtn{width:20px; height:20px; position:absolute; right:0; top:0; margin-right: 20px; background:#fff; line-height:20px; text-align: center; margin-top:10px; background:url(static/images/login.jpg) no-repeat center top; border-radius:50% 50%; color:#fff; cursor: color:#fff; cursor:pointer; background:#0d73f9;}
    .closeBtn-icon{}
    .maskMotal-title{padding-bottom:20px; padding-top:10px; font-size:14px; line-height:20px; padding-left:6px;}
    .maskMotal-box{ padding-top:4px; padding-bottom:4px;}
    .isTrask{margin-top:8px; margin-left:10px; width:14px; height:14px;}
    input.jm_file{width:65px; display:block; overflow:hidden;}
    .jm_fileCase{border:1px solid #ccc;}
    .jm_name{width:150px;}
    .jm_fileCase img{ width:100px; height:100px;}
    .input:disabled,.select:disabled,.textarea:disabled {
        background: #fff;
        cursor:default;
    }
    .maskMotal{overflow-y:scroll;}


</style>
<script type="text/javascript" src="static/js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="static/js/laydate/laydate.js"></script>
<script       src="http://md.yuxiaocloud.com/Public/modulesJs/scroll.js"></script>
<script>
$(function(){
  //1.日期选择
  var startTime;
  var endTime;
  function on1(){
    startTime=$('#STtime').val();
  }
  function on2(){
    endTime=$("#ETtime").val();
  }
  //开始时间
  laydate({
    elem: '#STtime',
    format: 'YYYY-MM-DD',
    choose: function (data) {
        on1();
    },
    istoday:true
  });
  //结束时间
  laydate({
    elem: '#ETtime',
    format: 'YYYY-MM-DD',
    choose: function (data){
        on2();
    },
    istoday:true
  });
  //2.获取商品列表ajax
  //以下是默认配置全局变量
  var nowPage=1;
  var nowSize=5;
  var nowTotal=100;
  var nowStartTime=$('#STtime').val()||'';
  var nowEndTime=$('#ETtime').val()||'';
  var nowMiniPrice=$('#Price_start').val()||'';
  var nowMaxPrice=$('#Price_end').val()||'';
  var nowMiniRate=$('#Race_start').val()||'0';
  var nowMaxRate=$('#Race_end').val()||'9';
  var nowGoodsName='';
  var mobile=window.localStorage.getItem("mobile");
  var password=window.localStorage.getItem("password");
  var wxUid=window.localStorage.getItem("wxUid");
  var wxSid="wxSid";
  var storeState="";//状态
  var GBcondition="1";
  var GBorderby="1";//倒序
  var storeNo=window.localStorage.getItem("storeNo")||'B02S0002';
  var marskAdd=false;
  var GgoodsUrl=[];
  var GgoodsUrl='';
  getProductList();
  function getProductList(){
    var param={data:
      {"mobile":mobile,
       "password":password,
       "wxUid":wxUid,
       "wxSid":wxSid,
       "page":nowPage,
       "size":nowSize,
       "condition":GBcondition,
       "orderby":GBorderby,//倒序
       "startTime":nowStartTime,
       "endTime":nowEndTime,
       "miniPrice":nowMiniPrice,
       "maxPrice":nowMaxPrice,
       "miniRate":nowMiniRate,//必填
       "maxRate":nowMaxRate,//必填
       "goodsName":nowGoodsName,
       "soldout":storeState,
       "storeNo":storeNo}
    }
    var params=JSON.stringify(param);
    console.log('-----获取商品列表接口打印参数-------',param,params);
    $.ajax({
      url:'http://dingdian-ppe.parllay.cn/wxserver/goods/selectGoodsListBysSalesclerk',
      data:params,
      type:'POST',
      async:false,
      contentType:'application/json',
      dataType:'json',
      success:function(res){
        var status=res.status;
        var data=res.data;
        if(status==true){
          console.log('-----获取商品列表-------',res);
          data=eval(data);
          nowTotal=res.total;
          $('.j_tb-tbody').html('');
          var itemsGoodList=[];
          for(var i=0; i<data.length; i++){
            var goodsDesc=data[i].goodsDesc.split(',')||['http://dingdian.parllay.cn/dist/images/logo.png'];
            var s_commendStatus='';
            if(data[i].commendStatus=='0'){
              s_commendStatus='否';
            }else if(data[i].commendStatus=='1'){
              s_commendStatus='是';
            }
            //上下架
            var s_soldout='';
            var s_soldoutBK='';
            //上下架class
            var soldoutClass='';
            if(data[i].soldout=='0'){
              s_soldout='上架';
              s_soldoutBK='下架';
              soldoutClass='';
            }else if(data[i].soldout=='1'){
              s_soldout='下架';
              s_soldoutBK='上架';
              soldoutClass='';
            }
            var Ele='<tr class="goodsItems" goodsItems="'+res.data[i]+'">'+
              '<td class="tb-goodCheck">'+
                '<div class="checkboxCase">'+
                  '<input type="checkbox" class="j_checkbox" checked;>'+
                '</div>'+
              '</td>'+
              '<td class="tb-goodName" goodsId="'+data[i].goodsId+'" goodsIndex="'+i+'">'+data[i].goodsName+'</td>'+
              '<td class="tb-imgCase">'+
                '<div class="tb-imgCase-case">'+
                  '<a href="javascript:;">'+
                    '<img src="'+goodsDesc[0]+'"/>'+
                  '</a>'+
                '</div>'+
              '</td>'+
              '<td class="tb-prevPrice">'+data[i].goodsPrice+'元</td>'+
              '<td class="tb-discountRace">'+data[i].discountRate+'&nbsp折</td>'+
              '<td class="tb-nowPrice">'+data[i].discountPrice+'元</td>'+
              '<td class="tb-onlineTime">'+data[i].soldonTime+'</td>'+
              '<td class="tb-storeFavrite">'+s_commendStatus+'</td>'+
              '<td class="tb-storeState">'+s_soldout+'</td>'+
              //'<td class="tb-isShowHome">操作</td>'+
              '<td class="tb-chose">'+
                '<div class="clearfix chooseCase">'+
                  '<a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>'+
                  '<a href="javascript:;" class="j_offline fl btn btn-primary">'+s_soldoutBK+'</a>'+
                '</div>'+
              '</td>'+
            '</tr>'
            //Ele=Ele+'';
            $('.j_tb-tbody').append(Ele);
          }
          $('.allcheckbox').attr({'checked':false});
          //联动全选allcheckbox
          $('.j_tb-thead').on('click','.allCheckbox',function(){
            //alert('@');
            if($('.allCheckbox:checked').length==0){
              $('.j_tb-tbody .j_checkbox').attr({'checked':false});
            }else{
              $('.j_tb-tbody .j_checkbox').attr({'checked':true});
            }
          });
          //全选allcheckbox
          $('.btn_table_selectAll').on('click',function(){
            //alert('@');
            //顶部chekbox
            $('.allCheckbox').attr({'checked':true});
            //全部下拉框
            $('.j_tb-tbody .j_checkbox').each(function(index){
              $(this).attr({'checked':true});
            });
          });
          //取消
          $('.btn_table_Cancle').on('click',function(){
            //alert('@');
            //顶部chekbox
            $('.allCheckbox').attr({'checked':false});
            //全部下拉框
            $('.j_tb-tbody .j_checkbox').each(function(index){
              $(this).attr({'checked':false});
            });
          });
          //联动列表checkbox
          $('.j_tb-tbody .j_checkbox').each(function(index){
            var prevLength=$('.j_tb-tbody .j_checkbox').length;
            //var _length=0;
            $(this).click(function(){
              var _this=$(this);
              if($('.j_tb-tbody .j_checkbox:checked').length==prevLength){
                $('.j_tb-thead .allCheckbox').attr({'checked':true});
              }else{
                $('.j_tb-thead .allCheckbox').attr({'checked':false});
              }
            });
          });
        }else{
          console.log('获取商品列表错误',res.message);
        }
      },
      error:function(err){
        console.log(err);
      }
    });
  }
  //上一页
  $('.jp_prev').click(function(){
    prevTap();
    function prevTap(){
      nowPage--;
      if(nowPage<=1){
        nowPage=1;
      }
      getProductList();
    }
  });
  //下一页
  $('.jp_next').click(function(){
    nextTap();
    function nextTap(){
      nowPage++;
      if(nowPage>parseInt(nowTotal/nowSize)){
        if(nowTotal%nowSize==0){
          nowPage=parseInt(nowTotal/nowSize);
        }else{
          nowPage=parseInt(nowTotal/nowSize)+1;
        }
      }
      getProductList();
    }
  });
  //重置
  $('.j_reset').on('click',function(){
    //reset
    $('.time-input1').val('');
    $('.time-input2').val('');
    $('.time-input3').val('');
    $('.time-input4').val('');
    $('.time-input5').val('');
    $('.time-input6').val('');
    $('#is_status option').attr({'selected':false});
    $('#is_status option').eq(0).attr({'selected':true});
    getProductList();
  });
  //查询
  $('.j_search').on('click',function(){
    searchTap();
    function searchTap(){
      //serchGoodsDetails
      mobile=window.localStorage.getItem("mobile");
      password=window.localStorage.getItem("password");
      nowStartTime=$('#STtime').val()||'';
      nowEndTime=$('#ETtime').val()||'';
      nowMiniPrice=$('#Price_start').val()||'';
      nowMaxPrice=$('#Price_end').val()||'';
      nowMiniRate=$('#Race_start').val()||'0';
      nowMaxRate=$('#Race_end').val()||'9';
      nowGoodsName=$('#sr_name').val()||'';
      storeState=$('#is_status option:selected').val()||'';
      var malue=$('#is_status option:selected').val();
      nowPage=1;
      getProductList();
    }
  });
  //3.query商品信息ajax
  $('.j_tb-tbody').on('click','.j_edit',function(){
    queryGoodsTap();
    function queryGoodsTap(){
      marskAdd=false;
      $('.maskMotal-title span').text('编辑商品');
      var _this=$(this);
      var Ele_goodsItems=_this.parents('.goodsItems');
      var _items_=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
      var BTitems=window.localStorage.getItem("BTitems");
      //往下是query商品
      //alert(_items);
      window.localStorage.setItem("_items",_items_);
      var _items=window.localStorage.getItem("_items");
      console.log('---Query---',_items_,_items);
      //查询按钮的值
      var wxSid='wxSid';
      var param={
        data:{
          'goodsId':_items
        }
      }
      var params=JSON.stringify(param);
      console.log('-----GetGoodsDetails-params-get---',param,params)
      $.ajax({
         url:'http://dingdian-ppe.parllay.cn/wxserver/home/getGoodsDetails',
         data:params,
         type:'POST',
         async:false,
         contentType:'application/json',
         dataType:'json',
         success:function(res){
            var data=res.data;
            var status=res.status;
            console.log('-----GetGoodsDetails-res-get---',res)
            if(status==true){
              $('.jm_name').val(data.goodsName);//name
              $('.jm_price').val(data.goodsPrice);//price
              $('.jm_rate').val(data.discountRate);//rate
              $('.jm_ratePrice').val(data.discountPrice);//ratePrice
              $('.jm_isSoldout').attr({'checked':false});
              $('.jm_isDiscount').attr({'checked':false});
              $('.jm_isCommend').attr({'checked':false});
              // alert(data.discountStatus);
              // alert(data.soldout);
              // alert(data.commendStatus);
              if(data.soldout=='0'){
                $('.jm_isSoldout').attr({'checked':true});
              }else if(data.soldout=='1'){
                $('.jm_isSoldout').attr({'checked':false});
              }
              if(data.discountStatus=='1'){
                $('.jm_isDiscount').attr({'checked':true});
              }else if(data.discountStatus=='0'){
                $('.jm_isDiscount').attr({'checked':false});
              }
              if(data.commendStatus=='1'){
                $('.jm_isCommend').attr({'checked':true});
              }else if(data.commendStatus=='0'){
                $('.jm_isCommend').attr({'checked':false});
              }
              //计算器$('.').on('input',function(){
              // if($(this).val()>10){
              //   $(this).val()=10;
              // }else if($(this).val()<=1){
              //     $(this).val()=1;
              // }
              //});
              //$('.').val($('.').val()*$('.').val())
              //如果是上架
            }else{

            }
         },
         error:function(res){
            //alert('err');
         }
      });
    }
  });
  //4.添加
  $('.j-additem').on('click',function(){
    addGoodsClearTap();
    function addGoodsClearTap(){
      if($('.j_maskLayout').is(':hidden')){
        $('.j_maskLayout').show();
        marskAdd=true;
        $('.maskMotal-title span').text('添加商品');
        var _this=$(this);
        var BTitems=window.localStorage.getItem("BTitems");
        var storeNo=window.localStorage.getItem("storeNo");
        var mobile=window.localStorage.getItem("mobile");
        var password=window.localStorage.getItem("password");
        var wxUid=window.localStorage.getItem("wxUid");
        var _items=window.localStorage.getItem("_items");
        var wxSid='wxSid';
        $('.jm_name').val('');
        $('.jm_price').val('');
        $('.jm_discountRate').val('');
        $('.jm_ratePrice').val('');
        $('.jm_isSoldout').attr({'checked':false});//是否下架
        $('.jm_isDiscount').attr({'checked':false});//时候打折
        $('.jm_isCommend').attr({'checked':false});//是否店长推荐
      }else{
        $('.j_maskLayout').hide();
        marskAdd=false;
      }
    }
  });
  //4.add&editGoodsDeails
  $('.j_maskLayout').on('click','.j_sure',function(){
    addAddEditGoodsTap();
    function addAddEditGoodsTap(){

      var _this=$(this);
      //var Ele_goodsItems=_this.parents('.goodsItems');
      //var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
      var BTitems=window.localStorage.getItem("BTitems");
      var storeNo=window.localStorage.getItem("storeNo");
      var mobile=window.localStorage.getItem("mobile");
      var password=window.localStorage.getItem("password");
      var wxUid=window.localStorage.getItem("wxUid");
      var _items=window.localStorage.getItem("_items");
      var wxSid='wxSid';
      //alert(_items);
      var data_goodsName=$('.jm_name').val();
      var data_goodsPrice=$('.jm_price').val();
      var date_discountRate=$('.jm_discountRate').val();
      var date_discountPrice=parseInt($('.jm_price').val())/100*parseInt($('.jm_discountRate').val())||'';
      var data_soldout=$('.jm_isSoldout:checked').length;//是否下架
      if(data_soldout){
        data_soldout==1;
      }else{
        data_soldout==0;
      }
      var data_discountStatus=$('.jm_isDiscount:checked').length;//时候打折
      if(data_discountStatus){
        data_discountStatus=0;
      }else{
        data_discountStatus=1;
      }
      var data_commendStatus=$('.jm_isCommend:checked').length;//是否店长推荐
      if(data_commendStatus){
        data_commendStatus=1;
      }else{
        data_commendStatus=0;
      }
      // alert(data_soldout);
      // alert(data_discountStatus);
      // alert(data_commendStatus);
      var param={
        data:{
          'wxSid':'wxSid',
          'wxUid':wxUid,
          'goodsName':data_goodsName,
          'goodsId':_items,
          'storeNo':storeNo,
          "goodsUrl":"http://dingdian.parllay.cn/resource/B02S0002/1/1.jpg,http://dingdian.parllay.cn/resource/B02S0002/2/2.jpg,http://dingdian.parllay.cn/resource/B02S0002/3/3.jpg",
          "goodsDesc":"http://dingdian.parllay.cn/resource/B02S0002/1/1.jpg",
          'goodsPrice':data_goodsPrice,
          'commendStatus':data_commendStatus,//推荐状态
          'discountPrice':date_discountPrice,
          'discountRate':date_discountRate,
          //'findStatus':'1',
          'soldout':data_soldout,//上架状态
          'discountStatus':data_discountStatus//打折状态
        }
      }
      var params=JSON.stringify(param);
      console.log('-----add&editGoodsDetails-params----',params)
      if(marskAdd==true){
        $.ajax({
           url:'http://dingdian-ppe.parllay.cn/wxserver/goods/addGoodsBysSalesclerk',
           data:params,
           type:'POST',
           async:false,
           contentType:'application/json',
           dataType:'json',
           success:function(res){
              var status=res.status;
              var data=res.data;
              console.log('-----addGoodsDetails-----',res)
              if(status==true){
                getProductList();
                $('.j_maskLayout').hide();
              }else{
                getProductList();
                $('.j_maskLayout').hide();
              }
           },
           error:function(res){
              $('.j_maskLayout').hide();
           }
        });
      }else{
        $.ajax({
           url:'http://dingdian-ppe.parllay.cn/wxserver/goods/updateGoodsBysSalesclerk',
           data:params,
           type:'POST',
           async:false,
           contentType:'application/json',
           dataType:'json',
           success:function(res){
              var status=res.status;
              var data=res.data;
              console.log('-----editGoodsDetails-----',res)
              if(status==true){
                getProductList();
                $('.j_maskLayout').hide();
              }else{
                getProductList();
                $('.j_maskLayout').hide();
              }
           },
           error:function(res){
              $('.j_maskLayout').hide();
           }
        });
      }
    }
  });
  //3@$
  loadFile('.jm_file','.jm_fileCase');
  //上传函数传iphone和andiod dom节点;图片盒子dom节点
  function loadFile(oparent,ImgCase){
    var oParents=$(oparent);
    oParents.each(function(index){
        //jsonIphoneReads[index]=null;
        var _this=$(this);
        _this.next('span').text();
        _this.next('span').text('请上传png格式图片');
        //_this.on('click',function(){
          _this.on('change',function(ev){
              var aFile=ev.srcElement.files;
              var oFile=aFile[0];
              //如果上传失败
              if(!oFile){
                var oImg=new Image();
                var _iCon=_this.parent().find('.icon img');
                oImg.src='';
                _iCon.attr({'src':''});
                _this.parents('.fileCase').find(ImgCase).html('');
                _this.parents('.fileCase').find(ImgCase).html($(oImg));
                _this.attr({'res':false});
                //if(!_this.val()){
                _iCon.attr({'src':oImg.result});
                _this.next('span').text('请上传png格式图片');
                if(oparent=='.j_cardOnInp'){
                  regPassengerCardOn=false;
                }else{
                  regPassengerCardBack=false;
                }
              }else{
                var read=new FileReader();
                read.readAsDataURL(oFile);
                read.onload=function(){
                    var oImg=new Image();
                    var _iCon=_this.parent().find('.icon img');
                    oImg.src=this.result;
                    _this.attr({'val':oImg.result});
                    _this.parents('.fileCase').find(ImgCase).html('');
                    _this.parents('.fileCase').find(ImgCase).html($(oImg));
                    _this.attr({'res':false});
                    _this.attr({'res':read.result});
                    _iCon.attr({'src':read.result});
                    //if(!_this.val()){
                    _this.attr({'val':_this.val()});
                    _this.next('span').text(_this.attr('val'));
                    if(oparent=='.j_cardBackInp'){
                      regPassengerCardOn=true;
                    }else{
                      regPassengerCardBack=true;
                    }
                    //获取七牛云token
                    uploadwidthsign();
                    function uploadwidthsign(){
                      var wxSid=window.localStorage.getItem('wxSid');
                      var wxUid=window.localStorage.getItem('wxUid');
                      var param={
                        'wxSid':'',
                        'wxUid':''
                      }
                      var params=JSON.stringify(param);
                      //ajax
                      console.log('qiniu',param,params);
                      $.ajax({
                         url:'http://dingdian-ppe.parllay.cn/wxserver/imgUpload/upload?wxSid=&wxUid=',
                         //data:params,
                         type:'GET',
                         async:false,
                         //contentType:'application/json',
                         dataType:'json',
                         success:function(res){
                            var status=res.status;
                            var code=res.code;
                            var data=res.data;
                            console.log('-----gettokien-----',res)
                            if(code==200){
                               console.log('-----gettokien--=^^^^^---',res)
                               window.localStorage.setItem('uptoken',res.uptoken)
                               //alert('(0)');
                               //alert(res.uptoken);
                                //requestqiniuyun(res.uptoken);
                                //0.七牛云上传接口
                                //$('.jm_file').onchange(fucntion(){
                                upload_withtoken();
                                //});
                                function upload_withtoken(){
                                  var upload_token="ulCeJ4skqUNYtKOhNpLtaJHCGtJhIZ0KlckGI86z:5KanKfmz9sWSB8blwzCdAye5LnQ=:eyJzY29wZSI6ImRpbmdzdG9yZWdvb2RzIiwiZGVhZGxpbmUiOjE1MjAzMjQzOTF9";
                                  //var file={"data":
                                  //file=eval(file);
                                  var param={
                                    'upload_token':upload_token,
                                    'file':$('.jm_file').attr('res')
                                  }
                                  var params=JSON.stringify(param);
                                  console.log('-----uploadqnwithloken-------',param,params);
                                  $.ajax({
                                    url:'http://upload.qiniup.com/multipart/form-data',
                                    data:param,
                                    type:'POST',
                                    async:false,
                                    //contentType:'application/json',
                                    dataType:'json',
                                    success:function(res){
                                      //返回
                                      console.log('--^^^**---uploadqnwithloken-------',param,params);
                                      alert(res);
                                    },
                                    serror:function(res){
                                      console.log('--^^^***---');
                                    }
                                  })
                                }
                            }
                         },
                         error:function(res){
                            $('.j_maskLayout').hide();
                         }
                      });
                    }

                    function requestqiniuyun(uptoken){
                      var wxSid=window.localStorage.getItem('wxSid');
                      var wxUid=window.localStorage.getItem('wxUid');
                      var param={
                        'token':uptoken,
                        'image':$('.jm_file').attr('res')
                      }
                      var params=JSON.stringify(param);
                      //ajax七牛云返回图片接口
                      console.log('qiniu',param,params);
                      $.ajax({
                         url:'http://upload.qiniu.com/putb64/20264',
                         data:params,
                         type:'POST',
                         async:false,
                         contentType:'application/json',
                         dataType:'json',
                         success:function(res){
                            var status=res.status;
                            var code=res.code;
                            var data=res.data;
                            console.log('-----requesttokien-----',res)
                            // if(code==200){
                               console.log('-----requesttokien--%%%---',res)
                               window.localStorage.setItem('uptoken',res.uptoken)
                               //alert(res.uptoken);
                            // }
                         },
                         error:function(res){
                            $('.j_maskLayout').hide();
                         }
                      });
                    }
                };
              }
          });
    });
}
  //过滤
  preNaN('.time-input1');
  preNaN('.time-input2');
  preNaN('.time-input3');
  preNaN('.time-input4');
  preNaN('.time-input5');
  preNaN('.time-input6');
  //preNaN('.j_prev')
  function preNaN(oParent){
      //alert(isNaN());
      //var oParent=$(oParent);
      //var oInp=oParent.children(".input");
      var oInp=$(oParent);
      var sEv="input";
      if(!document.addEventListener){
          sEv="keyup";
          //低版本禁止鼠标右键粘贴菜单
          oInp.contextmenu(function(){
              return false;
          });
      }
      //文字过滤成数字或小数点
      oInp.on(sEv,function(){
          oInp.val(oInp.val().replace(/[^\d|x|X]+/g,""));
      });
  }

  //5.offstoreGoodsDeails单个是否上架？
  $('.j_tb-tbody').on('click','.j_offline',function(){
      //onOffLineTap();
      //function onOffLineTap(){
        var _this=$(this);
        var Ele_goodsItems=_this.parents('.goodsItems');
        var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
        var BTitems=window.localStorage.getItem("BTitems");
        var storeNo=window.localStorage.getItem("storeNo");
        var mobile=window.localStorage.getItem("mobile");
        var password=window.localStorage.getItem("password");
        var wxUid=window.localStorage.getItem("wxUid");
        var wxSid='wxSid';
        //var SOLD_OUT="SOLD_OUT"||"SOLD_ON";
        var SOLD_="SOLD_OUT";
        if($(this).text()=='上架'){
          SOLD_="SOLD_ON";
        }
        var param={
          "data":{
             "ids":_items,
             "actionType":SOLD_
          }
        }
        //alert(SOLD_);
        var params=JSON.stringify(param);
        console.log('-----onOffGoodsStatus-params----',params)
        $.ajax({
           url:'http://dingdian-ppe.parllay.cn/wxserver/goods/updateGoodsStatus',
           data:params,
           type:'POST',
           async:false,
           contentType:'application/json',
           dataType:'json',
           success:function(res){
              var status=res.status;
              var data=res.data;
              console.log('-----onOffGoodsStatus-----',res)
              if(status==true){
                //获取商品列表ajax
                getProductList();
                //$('.j_maskLayoutConfirm').hide();
              }else{
                //$('.j_maskLayoutConfirm').hide();
              }
           },
           error:function(res){
              //$('.j_maskLayoutConfirm').hide();
           }
        });
    ////}
  });
  //6.offstoreGoodsDeails批量是否上架？
  $('.j-setStatusOn').on('click',function(){
    togetherOnLineTap();
    function togetherOnLineTap(){
      //联动列表checkbox
      var itemss=[];
      $('.j_tb-tbody .j_checkbox:checked').each(function(index){
          //if($(this).attr('checked')==true){
          var _this=$(this);
          var Ele_goodsItems=_this.parents('.goodsItems');
          var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
          itemss.push(_items);
        //}
      });
      var itemstring=itemss.join(',')||'';
      //alert(typeof(itemss));
      var _this=$(this);
      var Ele_goodsItems=_this.parents('.goodsItems');
      var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
      //window.localStorage.setItem("_items",_items);
      var BTitems=window.localStorage.getItem("BTitems");
      var storeNo=window.localStorage.getItem("storeNo");
      var mobile=window.localStorage.getItem("mobile");
      var password=window.localStorage.getItem("password");
      var wxUid=window.localStorage.getItem("wxUid");
      var wxSid='wxSid';
      //var SOLD_OUT="SOLD_OUT"||"SOLD_ON";
      var SOLD_="SOLD_ON";
      var param={
        "data":{
           "ids":itemstring,
           "actionType":SOLD_
        }
      }
      //alert(itemstring);
      //alert(SOLD_);
      var params=JSON.stringify(param);
      console.log('-----onOffGoodsStatus-params----',params)
      $.ajax({
         url:'http://dingdian-ppe.parllay.cn/wxserver/goods/updateGoodsStatus',
         data:params,
         type:'POST',
         async:false,
         contentType:'application/json',
         dataType:'json',
         success:function(res){
            var status=res.status;
            var data=res.data;
            console.log('-----onOffGoodsStatus-----',res)
            if(status==true){
              //获取商品列表ajax
              getProductList();
              //$('.j_maskLayoutConfirm').hide();
            }else{
              //$('.j_maskLayoutConfirm').hide();
            }
         },
         error:function(res){
            //$('.j_maskLayoutConfirm').hide();
         }
      });
    };
  });

  //7.offstoreGoodsDeails批量是否下架？
  $('.j-setStatusOff').on('click',function(){
    togetherOffLineTap();
    function togetherOffLineTap(){
      //联动列表checkbox
      var itemss=[];
      $('.j_tb-tbody .j_checkbox:checked').each(function(index){
          //if($(this).attr('checked')==true){
          var _this=$(this);
          var Ele_goodsItems=_this.parents('.goodsItems');
          var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
          itemss.push(_items);
        //}
      });
      var itemstring=itemss.join(',')||'';
      //alert(typeof(itemss));
      var _this=$(this);
      var Ele_goodsItems=_this.parents('.goodsItems');
      var _items=Ele_goodsItems.find('.tb-goodName').attr('goodsid');
      //window.localStorage.setItem("_items",_items);
      var BTitems=window.localStorage.getItem("BTitems");
      var storeNo=window.localStorage.getItem("storeNo");
      var mobile=window.localStorage.getItem("mobile");
      var password=window.localStorage.getItem("password");
      var wxUid=window.localStorage.getItem("wxUid");
      var wxSid='wxSid';
      //var SOLD_OUT="SOLD_OUT"||"SOLD_ON";
      var SOLD_="SOLD_OUT";
      var param={
        "data":{
           "ids":itemstring,
           "actionType":SOLD_
        }
      }
      //alert(itemstring);
      //alert(SOLD_);
      var params=JSON.stringify(param);
      console.log('-----onOffGoodsStatus-params----',params)
      $.ajax({
         url:'http://dingdian-ppe.parllay.cn/wxserver/goods/updateGoodsStatus',
         data:params,
         type:'POST',
         async:false,
         contentType:'application/json',
         dataType:'json',
         success:function(res){
            var status=res.status;
            var data=res.data;
            console.log('-----onOffGoodsStatus-----',res)
            if(status==true){
              //获取商品列表ajax
              getProductList();
              //$('.j_maskLayoutConfirm').hide();
            }else{
              //$('.j_maskLayoutConfirm').hide();
            }
         },
         error:function(res){
            //$('.j_maskLayoutConfirm').hide();
         }
      });
    }
  });
// 上传图片http://dingdian-ppe.parllay.cn/wxserver/imgUpload/upload
// {
//     "data":{
//        "wxUid":"25714b2d-40c8-4d86-b8e8-c0954dc75982",
//         "wxSid":"wxSid"
//     }
// }

//下架接口
//http://dingdian-ppe.parllay.cn/wxserver/goods/updateGoodsStatus
// {
//     "data":{
//        "ids":"1900,1901,1902,1903,1904",
//        "actionType":"SOLD_OUT"
//        "actionType":"SOLD_ON"
//     }
// }

  //6.j_tableList
  // $('.j_tableList').on('',function(){
  //
  // });
  //点击关闭弹框页
  $('.j_sure').click(function(){
    $('.j_maskLayout').hide();
    $('.j_maskLayoutConfirm').hide();
  });
  $('.j_cans').click(function(){
    $('.j_maskLayout').hide();
    $('.j_maskLayoutConfirm').hide();
  });
  $('.closeBtn').click(function(){
    $('.j_maskLayout').hide();
    $('.j_maskLayoutConfirm').hide();
  });
  //打开弹框页
  $('.j_tb-tbody').on('click','.j_edit',function(){
    //执行代码
    //alert('123');
    if($('.j_maskLayout').is(':hidden')){
      $('.j_maskLayout').show();
    }
  });
  //打开弹框页
  // $('.j_tb-tbody').on('click','.j_offline',function(){
  //   if($('.j_maskLayoutConfirm').is(':hidden')){
  //     $('.j_maskLayoutConfirm').show();
  //   }
  // });
  //$('#content-left').html('');
});
</script>
</head>
<body class="cp-bodybox">
<div class="goodsId" class="j_edit_goodsId"></div>
<div class="container">
<div class="inner clearfix" >
<!-- subBar 开始 -->
<div id="content-left" class="content-left fl">
  <dl class="left-menu shop_1 sub_home">
    <dt>
      <i class="icon-menu cabinet"></i>
      <span id="shop_1" data-id="1">叮店管理</span>
    </dt>
    <dd class="subshop_0">
      <a data-href="/MyStore/setting">店铺管理</a>
    </dd>
  </dl>
  <dl class="left-menu shop_2 sub_home">
    <dt>
      <i class="icon-menu commodity"></i>
      <span id="shop_2" data-id="2">活动管理</span>
    </dt>
    <dd class="subshop_2">
        <a data-href="/Item/shop_items_l">活动</a>
    </dd>
    <dd class="subshop_4 ">
      <a data-href="/Item/list_class"></a>
    </dd>
  </dl>
  <dl class="left-menu shop_6 sub_home">
    <dt>
      <i class="icon-menu signup"></i>
      <span id="shop_6" data-id="6">商品管理</span>
    </dt>
    <dd class="subshop_0">
      <a data-href="/Order/lists">商品列表</a>
    </dd>
    <dd class="subshop_1">
      <a data-href="/Order/customerLists">商品分类</a>
    </dd>
    <dd class="subshop_2">
      <a data-href="/Order/packageLists"></a>
    </dd>
    <dd class="subshop_3">
      <a data-href="/Order/export"></a>
    </dd>
  </dl>
  <dl class="left-menu shop_7 sub_home" style="display:none;">
    <dt>
        <i class="icon-menu "></i>
        <span id="shop_7" data-id="7"></span>
    </dt>
    <dd class="subshop_0 ">
        <a data-href="/BusinessMan/index"></a>
    </dd>
    <dd class="subshop_1 ">
        <a data-href="/RoomManage/index"></a>
    </dd>
  </dl>
  <dl class="left-menu shop_5 sub_home">
    <dt>
        <i class="icon-menu cog"></i>
        <span id="shop_5" data-id="5">设置</span>
    </dt>
    <dd class="subshop_0">
      <a data-href="/System/updatepwd">修改密码</a>
    </dd>
  </dl>
</div>
<!-- subBar 结束-->
<!--右边主体部分 开始-->
<div class="content-right " style="min-height: 1200px;">
    <a href="javascript:;" class="btn-leftMenuFold" id="j-btn-leftMenuFold"></a>
    <h1 class="content-right-title">商品列表</h1>
  	<a href="javascript:;" class="btn btn-success j-additem">添加新商品</a>

    <!--条件查询 开始-->
    <div class="clearfix">
      <div class="fl lableCase j_prev">
        <label for="" class="fl lable">商品添加时间:</label>
        <input type="text" placeholder="" id="STtime" class="input time-input time-input1 fl" name="title" value="">
        <span class="fl toget">-</span>
        <input type="text" placeholder="" id="ETtime" class="input time-input time-input2 fl" name="title" value="">
      </div>
      <div class="fl lableCase j_prev">
        <label for="" class="fl lable">价格区间:</label>
        <input type="text" placeholder="" id="Price_start" class="input time-input time-input3 fl" name="title" value="">
        <span class="fl toget">-</span>
        <input type="text" placeholder="" id="Price_end" class="input time-input time-input4 fl" name="title" value="">
      </div>
    </div>
    <div class="clearfix">
      <div class="fl lableCase j_prev">
        <label for="" class="fl lable">折扣区间:</label>
        <input type="text" placeholder="" id="Race_start" class="input time-input time-input5 fl" name="title" value="">
        <span class="fl toget">-</span>
        <input type="text" placeholder="" id="Race_end" class="input time-input time-input6 fl" name="title" value="">
      </div>
    </div>
    <!--条件查询 结束-->
    <div class="tables-searchbox newcearchbox clearfix">
        <input type="text" placeholder="商品名称" id="sr_name" class="input fl" name="title" value="">
        <select name="is_status" id="is_status" class="select fl small newselect" value="">
            <option value="" selected>所有状态</option>
            <option value="0">上架</option>
            <option value="1">下架</option>
        </select>
        <div class="fl lableCase check-sure">
          <a href="javascript:;" class="fl j_search btn btn-primary margin-r-30">查询</a>
          <a href="javascript:;" class="fl j_reset btn btn-primary">重置</a>
        </div>
    </div>
    <div class="tablesWrap j_tableListWrap mgt10">
      <table id="j_tableList" class="wxtables j_tableList">
  		    <thead class="tb-thead j_tb-thead" style="">
  		        <tr class="po_list">
  		            <th width="50px;">
                    <!--<i class="icon_check"></i> -->
                    <input class="allCheckbox" type="checkbox" value="">
                  </th>
                  <th width="100px;">商品名称</th>
                  <th width="100px;">商品图片</th>
                  <th width="100px;">原价</th>
                  <th width="100px;">折扣</th>
                  <th width="100px;">折扣价</th>
                  <th width="100px;">上架时间</th>
                  <th width="100px;">店长推荐</th>
                  <th width="100px;">状态</th>
                  <!-- <th width="100px;">是否首页展示</th> -->
                  <th width="200px;">操作</th>
  		        </tr>
  		    </thead>
  		    <tbody class="tb-tbody j_tb-tbody">
            <tr class="goodsItems" goodsItems="goodsItems">
              <td class="tb-goodCheck" goodsId="">
                <div class="checkboxCase">
                  <input type="checkbox" class="j_checkbox" checked>
                </div>
              </td>
              <td class="tb-goodName">格子吊带毛织连衣裙花灰</td>
              <td class="tb-imgCase">
                <div class="tb-imgCase-case">
                  <a href="javascript:;">
                    <img src="http://p1az9gcpw.bkt.clouddn.com/FvKl19Np9mR_DcSZ2fp1ZQOEosIk"/>
                  </a>
                </div>
              </td>
              <td class="tb-prevPrice">639.00元</td>
              <td class="tb-discountRace">1 折</td>
              <td class="tb-nowPrice">63.90元</td>
              <td class="tb-onlineTime">2018-01-26</td>
              <td class="tb-storeFavrite">否</td>
              <td class="tb-storeState">下架</td>
              <!-- <td class="tb-isShowHome">操作</td> -->
              <td class="tb-chose">
                <div class="clearfix chooseCase">
                  <a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>
                  <a href="javascript:;" class="j_offline fl btn btn-primary">下架</a>
                </div>
              </td>
            </tr>
            <tr class="goodsItems" goodsItems="goodsItems">
              <td class="tb-goodCheck" goodsId="">
                <div class="checkboxCase">
                  <input type="checkbox" class="j_checkbox" checked>
                </div>
              </td>
              <td class="tb-goodName">格子吊带毛织连衣裙花灰</td>
              <td class="tb-imgCase">
                <div class="tb-imgCase-case">
                  <a href="javascript:;">
                    <img src="http://p1az9gcpw.bkt.clouddn.com/FvKl19Np9mR_DcSZ2fp1ZQOEosIk"/>
                  </a>
                </div>
              </td>
              <td class="tb-prevPrice">639.00元</td>
              <td class="tb-discountRace">1 折</td>
              <td class="tb-nowPrice">63.90元</td>
              <td class="tb-onlineTime">2018-01-26</td>
              <td class="tb-storeFavrite">否</td>
              <td class="tb-storeState">下架</td>
              <!-- <td class="tb-isShowHome">操作</td> -->
              <td class="tb-chose">
                <div class="clearfix chooseCase">
                  <a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>
                  <a href="javascript:;" class="j_offline fl btn btn-primary">下架</a>
                </div>
              </td>
            </tr>
            <tr class="goodsItems" goodsItems="goodsItems">
              <td class="tb-goodCheck" goodsId="">
                <div class="checkboxCase">
                  <input type="checkbox" class="j_checkbox" checked>
                </div>
              </td>
              <td class="tb-goodName">格子吊带毛织连衣裙花灰</td>
              <td class="tb-imgCase">
                <div class="tb-imgCase-case">
                  <a href="javascript:;">
                    <img src=""/>
                  </a>
                </div>
              </td>
              <td class="tb-prevPrice">639.00元</td>
              <td class="tb-discountRace">1 折</td>
              <td class="tb-nowPrice">63.90元</td>
              <td class="tb-onlineTime">2018-01-26</td>
              <td class="tb-storeFavrite">否</td>
              <td class="tb-storeState">下架</td>
              <!-- <td class="tb-isShowHome">操作</td> -->
              <td class="tb-chose">
                <div class="clearfix chooseCase">
                  <a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>
                  <a href="javascript:;" class="j_offline fl btn btn-primary">下架</a>
                </div>
              </td>
            </tr>
            <tr class="goodsItems" goodsItems="goodsItems">
              <td class="tb-goodCheck" goodsId="">
                <div class="checkboxCase">
                  <input type="checkbox" class="j_checkbox" checked;>
                </div>
              </td>
              <td class="tb-goodName">格子吊带毛织连衣裙花灰</td>
              <td class="tb-imgCase">
                <div class="tb-imgCase-case">
                  <a href="javascript:;">
                    <img src=""/>
                  </a>
                </div>
              </td>
              <td class="tb-prevPrice">639.00元</td>
              <td class="tb-discountRace">1 折</td>
              <td class="tb-nowPrice">63.90元</td>
              <td class="tb-onlineTime">2018-01-26</td>
              <td class="tb-storeFavrite">否</td>
              <td class="tb-storeState">下架</td>
              <!-- <td class="tb-isShowHome">操作</td> -->
              <td class="tb-chose">
                <div class="clearfix chooseCase">
                  <a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>
                  <a href="javascript:;" class="j_offline fl btn btn-primary">下架</a>
                </div>
              </td>
            </tr>
            <tr class="goodsItems" goodsItems="goodsItems">
              <td class="tb-goodCheck" goodsId="">
                <div class="checkboxCase">
                  <input type="checkbox" class="j_checkbox" checked;>
                </div>
              </td>
              <td class="tb-goodName">格子吊带毛织连衣裙花灰</td>
              <td class="tb-imgCase">
                <div class="tb-imgCase-case">
                  <a href="javascript:;">
                    <img src=""/>
                  </a>
                </div>
              </td>
              <td class="tb-prevPrice">639.00元</td>
              <td class="tb-discountRace">1 折</td>
              <td class="tb-nowPrice">63.90元</td>
              <td class="tb-onlineTime">2018-01-26</td>
              <td class="tb-storeFavrite">否</td>
              <td class="tb-storeState">下架</td>
              <!-- <td class="tb-isShowHome">操作</td> -->
              <td class="tb-chose">
                <div class="clearfix chooseCase">
                  <a href="javascript:;" class="j_edit fl btn btn-primary margin-r-10 margin-l-20">编辑</a>
                  <a href="javascript:;" class="j_offline fl btn btn-primary">下架</a>
                </div>
              </td>
            </tr>
        </tbody>
  		</table>

      <div class="clearfix nextPageCase">
        <a href="javascript:;" class="fr jp_next btn btn-primary margin-r-60">下一页</a>
        <a href="javascript:;" class="fr jp_prev btn btn-primary margin-r-10">上一页</a>
      </div>
      <!--设置 结束-->
      <div class="tables-btmctrl clearfix">
        <div class="mgt10">
            <a href="javascript:;" class="btn btn-primary btn_table_selectAll">全选</a>
            <a href="javascript:;" class="btn btn-primary btn_table_Cancle">取消</a>
            <a href="javascript:;" class="btn btn-warning j-setStatusOn" data-status="1" data-action="update_status">批量上架</a>
            <a href="javascript:;" class="btn btn-warning j-setStatusOff" data-status="0" data-action="update_status">批量下架</a>
            <!-- <a href="javascript:;" class="btn btn-warning j-setStatus" data-status="1" data-action="update_is_show_home_page">设置首页展示</a>
            <a href="javascript:;" class="btn btn-warning j-setStatus" data-status="0" data-action="update_is_show_home_page">取消首页展示</a>
            <a href="javascript:;" class="btn btn-warning j-setClass" data-shop_id="" data-action="set_item_class">批量设置分类</a>-->
            <div class="paginate">
          </div>
          <!-- end paginate -->
        </div>
      </div>
      <!--设置 结束-->
    </div>
</div>
<!--右边主体 结束-->
</div>
</div>
<!--end container-->
<!--模态框 开始-->
<div class="maskLayout j_maskLayout" style="display:none;">
  <div class="Layouter" style="display:block;"></div>

  <div class="maskMotal" style="display:block;">
    <div class="closeBtn">
      <div class="closeBtn-icon">x</div>
    </div>
    <h3 class="clearfix maskMotal-title"><span class="span">添加新商品</span>（带<i class="icon must-icon"> * </i>的是必填项）</h3>
    <div class="clearfix maskMotal-box">
      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">商品名:</label>
          <input type="text" placeholder="" class="jm_name input time-input fl" name="title" value="">
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">原价:</label>
          <input type="text" placeholder="" class="jm_price input time-input fl" name="title" value="">
          <span class="fl toget">元</span>
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">是否打折:</label>
          <input type="checkbox" class="jm_isRate jm_isDiscount fl isTrask" name="title" value="">
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">折扣:</label>
          <input type="number" placeholder="" class="jm_rate jm_discountRate input time-input fl" name="title" value="">
          <span class="fl toget">折</span>
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon fl">*</i>
          <label for="" class="fl lable">折后价:</label>
          <input type="text" class="jm_ratePrice fl input time-input" name="title" value="" disabled>
          <span class="fl toget">元</span>
        </div>
      </div>

      <div class="clearfix">
        <div class="lableCase clearfix">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">添加图片:</label>
          <div class="imgItem fl fileCase clearfix">
            <input type="file" style="float:none;" class="jm_file"/>
            <span class="icon" style="float:none;">请上传png格式图片</span>
            <div class="j_OnImgCase jm_fileCase" style="width:100px; height:100px; display:block; float:none;">
              <img class="img j-OnImgCase" style="width:100px; height:100px;" src="" alt="">
            </div>
          </div>
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon must-icon fl">*</i>
          <label for="" class="fl lable">是否上架:</label>
          <input type="checkbox" class="jm_isSoldout isTrask fl" name="title" value="">
        </div>
      </div>

      <div class="clearfix">
        <div class="fl lableCase">
          <i class="icon fl">*</i>
          <label for="" class="fl lable">是否设为店长推荐:</label>
          <input type="checkbox" class="jm_isCommend isTrask fl" name="title" value="">
        </div>
      </div>

    </div>
    <div class="fl lableCase check-sure">
      <a href="javascript:;" class="j_sure fl btn btn-primary margin-r-30">保存</a>
      <a href="javascript:;" class="j_cans fl btn btn-primary">取消</a>
    </div>
  </div>
</div>
<!--模态框 结束-->
<!--模态框2 开始-->
<div class="maskLayout j_maskLayoutConfirm" style="display:none;">
  <div class="Layouter" style="display:block;"></div>
  <div class="maskMotal maskMotalConfirm" style="display:block;">
    <div class="closeBtn">
      <div class="closeBtn-icon">x</div>
    </div>
    <h3 class="clearfix maskMotal-title">确认下架吗？</h3>


    <div class="fl lableCase check-sure">
      <a href="javascript:;" class="j_sure_check fl btn btn-primary margin-r-30">确认</a>
      <a href="javascript:;" class="j_cans_check fl btn btn-primary">取消</a>
    </div>
  </div>
</div>
<!--模态框2 结束-->
</body>
</html>
